<%--
  Created by IntelliJ IDEA.
  User: 栋
  Date: 2022/11/28
  Time: 18:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>个人商品信息</title>
    <%@include file="/pages/base/base.jsp"%>
</head>
<body>
<div class="container">
    <%@include file="/pages/base/head.jsp"%>
    <%@include file="/pages/base/topnav_afterLogin.jsp"%>
    <div class="errorMsg">
        ${ empty requestScope.msg ? "":requestScope.msg }
    </div>
    <c:if test="${sessionScope.personalItems!=null}">
        <table id="personalItems_tb">
            <tr>
                <th>图片</th>
                <th>商品编号</th>
                <th>商品名称</th>
                <th>商品类型</th>
                <th>商品数量</th>
                <th>商品单价</th>
                <th>商品简介</th>
                <th>交易方式</th>
                <th>申请日期</th>
                <th>申请时间</th>
                <th>是否合格</th>
                <th>审核管理员id</th>
                <th>审核日期</th>
                <th>审核时间</th>
                <th>管理商品</th>
            </tr>
            <c:forEach items="${sessionScope.personalItems}" var="item">
                <tr>
                    <td><img src="${item.item_img}" width="100px" height="100px"></td>
                    <td>${item.item_id}</td>
                    <td>${item.item_name}</td>
                    <td>
                        <c:set var="t" scope="request" value="${item.item_type}"/>

                        <c:choose>
                            <c:when test="${t==1}">
                                书籍
                            </c:when>
                            <c:when test="${t==2}">
                                电子产品
                            </c:when>
                            <c:when test="${t==3}">
                                生活用品
                            </c:when>
                            <c:when test="${t==4}">
                                学习用品
                            </c:when>
                        </c:choose>
                    </td>
                    <td>${item.item_count}</td>
                    <td>${item.item_price}</td>
                    <td>${item.item_introduce}</td>
                    <td>${item.method}</td>
                    <td>${item.app_date}</td>
                    <td>${item.app_time}</td>
                    <td>${empty item.is_qualified?"暂未审核":item.is_qualified}</td>
                    <td>${empty item.admin_id ?"暂未审核":item.admin_id}</td>
                    <td>${empty item.audit_date ?"暂未审核":item.audit_date}</td>
                    <td>${empty item.audit_time ?"暂未审核":item.audit_time}</td>
                    <td><a href="itemServlet?action=deleteItem&item_id=${item.item_id}">下架产品</a></td>
                </tr>
            </c:forEach>
        </table>
    </c:if>

</div>
</body>
</html>
